package org.streets.extention.quartz;

import org.quartz.Job;

/**
 * 定时任务定义
 * @author dzb
 *
 */
public class QuartzJob {
	
    private String group;
	private String name;
	private Class<? extends Job> task;
	// 1为自动运行 非1为手动运行
	private int mode; 
	private String expression;
	
	public QuartzJob (String group, String name, Class<? extends Job> jobClass, String expression) {
		this.group = group ;
		this.name = name ;
		this.task = jobClass ;
		this.expression = expression ;
	}
	/**
	 * convenience pack method
	 * @param group
	 * @param name
	 * @param jobClass
	 * @param expression
	 * @return
	 */
	public static QuartzJob pack(String group, String name, Class<? extends Job> jobClass, String expression) {		
		return new QuartzJob(group, name, jobClass, expression);
	}

    /**
     * @return the group
     */
    public String getGroup() {
        return group;
    }
    /**
     * @param group the group to set
     */
    public void setGroup(String group) {
        this.group = group;
    }
    
	public String getName() {
		return name;
	}
	
	public void setName(String taskName) {
		this.name = taskName;
	}

	public Class<?> getType() {
		return task;
	}
	
	public void setType(Class<? extends Job> jobClass) {
		this.task = jobClass;
	}
	
	public int getMode() {
		return mode;
	}
	
	public void setMode(int mode) {
		this.mode = mode;
	}

	public String getExpression() {
		return expression;
	}
	
	public void setExpression(String expression) {
		this.expression = expression;
	}

}
